package com.example.xpvideo.service.serviceImpl;

import com.example.xpvideo.entity.LocalGoodsRelationship;
import com.example.xpvideo.mapper.LocalGoodsRelationshipMapper;
import com.example.xpvideo.service.LocalGoodsRelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 本地生活商品和商铺对应关系表(LocalGoodsRelationship)Service层
 *
 * @author 
 * @since 2021-09-17 01:35:54
 */
@Service
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class LocalGoodsRelationshipServiceImpl implements LocalGoodsRelationshipService {
        @Autowired
        private LocalGoodsRelationshipMapper localGoodsRelationshipMapper;


 /**
     * 通过ID和其他条件查询单条数据
     *
     * @param localGoodsRelationship 实例对象
     * @return 实例对象
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public LocalGoodsRelationship queryLocalGoodsRelationshipLimit1(LocalGoodsRelationship localGoodsRelationship){
     return  localGoodsRelationshipMapper.queryLocalGoodsRelationshipLimit1( localGoodsRelationship);
     }
     
 /**
     * 查询指定行数据
     * @param localGoodsRelationship 实例对象
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   List<LocalGoodsRelationship> queryAllLocalGoodsRelationshipByLimit( LocalGoodsRelationship localGoodsRelationship, Integer offset,  Integer limit){
   return localGoodsRelationshipMapper.queryAllLocalGoodsRelationshipByLimit(localGoodsRelationship, offset,limit);
  }

  /**
     * 查询数据条数
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int countAllLocalGoodsRelationship(LocalGoodsRelationship localGoodsRelationship){
   return localGoodsRelationshipMapper.countAllLocalGoodsRelationship( localGoodsRelationship);
   }
   /**
     * 通过实体作为筛选条件查询
     *
     * @param localGoodsRelationship 实例对象
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public List<LocalGoodsRelationship> queryAllLocalGoodsRelationship(LocalGoodsRelationship localGoodsRelationship){
   return localGoodsRelationshipMapper.queryAllLocalGoodsRelationship(localGoodsRelationship);
   }
  /**
     * 新增数据
     *
     * @param localGoodsRelationship 实例对象
     * @return 影响行数
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public int insertLocalGoodsRelationship(LocalGoodsRelationship localGoodsRelationship){
    return  localGoodsRelationshipMapper.insertLocalGoodsRelationship( localGoodsRelationship);
    }
  /**
     * 修改数据
     *
     * @param localGoodsRelationship 实例对象
     * @return 影响行数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public  int updateLocalGoodsRelationship(LocalGoodsRelationship localGoodsRelationship){
         return localGoodsRelationshipMapper.updateLocalGoodsRelationship( localGoodsRelationship);
     }

    /**
     * 通过主键删除数据
     * @param id 主键
     * @return 影响行数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int deleteLocalGoodsRelationshipById(Integer id){
   return  localGoodsRelationshipMapper.deleteLocalGoodsRelationshipById( id);
   }
     /**
     * 通过主键列表删除，列表长度不能为0
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int deleteLocalGoodsRelationshipByIds( List<Integer> list){
    return  localGoodsRelationshipMapper.deleteLocalGoodsRelationshipByIds(  list);
  }
    
       /**
     * 通过主键修改实体列表，列表长度不能为0，注意：当实体属性为null时，对应的列也会别更新为null
     * @param list 集合
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int updateLocalGoodsRelationshipBatch( List<LocalGoodsRelationship> list){
   return  localGoodsRelationshipMapper.updateLocalGoodsRelationshipBatch(list);
   }
    /**
     * 批量其他列,除主键以外的列，列表长度不能为0,字段是空的就置为null
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
 public   int insertLocalGoodsRelationshipBatch( List<LocalGoodsRelationship> list){
 return localGoodsRelationshipMapper.insertLocalGoodsRelationshipBatch( list);
 }
      /**
     * 通过实体非空属性删除
     * @param localGoodsRelationship  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   int deleteLocalGoodsRelationshipByEntity( LocalGoodsRelationship localGoodsRelationship){
  return  localGoodsRelationshipMapper.deleteLocalGoodsRelationshipByEntity(  localGoodsRelationship);
  }
    /**
     * 通过实体不为空的属性作为筛选条件查询列表
     * @param localGoodsRelationship  实体
     * @return list
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  List<LocalGoodsRelationship> listLocalGoodsRelationshipByEntity(LocalGoodsRelationship localGoodsRelationship){
   return localGoodsRelationshipMapper.listLocalGoodsRelationshipByEntity( localGoodsRelationship);
   }

 /**
     * 新增实体属性不为null的列
     * @param localGoodsRelationship  实体
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int insertLocalGoodsRelationshipSelect( LocalGoodsRelationship localGoodsRelationship){
      return localGoodsRelationshipMapper.insertLocalGoodsRelationshipSelect( localGoodsRelationship);

   }
   
      /**
     * 批量新增新增实体属性不为null的列
     * @param list  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int insertLocalGoodsRelationshipListSelect( List<LocalGoodsRelationship> list){

     return localGoodsRelationshipMapper.insertLocalGoodsRelationshipListSelect( list);
      }
     /**
     * 通过实体不为空的属性作为筛选条件查询单个
     * @param localGoodsRelationship  实体
     * @return 单个
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public  LocalGoodsRelationship getLocalGoodsRelationshipByEntity(LocalGoodsRelationship localGoodsRelationship){
     return  localGoodsRelationshipMapper.getLocalGoodsRelationshipByEntity(localGoodsRelationship);
    }

}

